using DataTestFramework.NHibernate.Models;

using FluentNHibernate.Mapping;

using NHibernate.Mapping.ByCode;
using NHibernate.Mapping.ByCode.Conformist;


namespace DataTestFramework.NHibernate.Mappers
{
    public class NhCategoryMapping : ClassMap<NhCategory>
    {
        public NhCategoryMapping()
        {
            Table("Categories");
            Id(m => m.CategoryId).GeneratedBy.Identity();
            Map(m => m.CategoryName).Length(50).Not.Nullable();
            HasMany(m => m.Products).KeyColumn("ProductId").LazyLoad();
        }
    }
}
